package hhm.android.library.weightHeightPicker.weightPicker;

import androidx.annotation.NonNull;

import java.util.ArrayList;

import hhm.android.library.datePicker.adapter.GeneralWheelAdapter;

public abstract class BaseWeightAdapter extends GeneralWheelAdapter {

    protected WeightParams mDateParams;
    protected WeightPick mDatePick;

    public BaseWeightAdapter(@NonNull WeightParams dateParams, @NonNull WeightPick datePick, int selectColor) {
        super(selectColor);
        this.mDateParams = dateParams;
        this.mDatePick = datePick;
        refreshValues();
    }

    public abstract int getCurrentIndex();

    public abstract void refreshValues();

    @Override
    public String getItem(int position) {
        int value = mData.get(position);
        return value < 10 ? ("0" + value) : String.valueOf(value);
    }

    public final ArrayList<Integer> getArray(int maxNum) {
        ArrayList<Integer> values = new ArrayList<>();
        for (int i = 1; i <= maxNum; i++) {
            values.add(i);
        }
        return values;
    }

    @Override
    public String getCla() {
        return "";
    }
}
